class RankCell extends eui.ItemRenderer{

	public txt_rank:eui.Label;

	public txt_user_name:eui.Label;

	public txt_level:eui.Label;

	public img_header:eui.Image;

	public rank_bg:eui.Rect;

	public line:eui.Rect;
	public constructor() {
		super();
		this.skinName = "RankCellSkin";
	}

	
	//{url,nick,score,selfFlag}
	public dataChanged(){
		this.txt_rank.text = ""+(this.itemIndex+ 1);
		this.txt_user_name.text = this.data.nick;
		this.txt_level.text = this.data.score+"关";
		RES.getResByUrl(this.data.url,this.onComplete,this,RES.ResourceItem.TYPE_IMAGE);
		if(this.itemIndex == 0){
			this.rank_bg.fillColor = 0xEC8B89;
		}else if(this.itemIndex == 1){
			this.rank_bg.fillColor = 0x76DDBB;
		}else if(this.itemIndex == 2){
			this.rank_bg.fillColor = 0xEEBF4A;
		}else{
			this.rank_bg.fillColor = 0xBBC5CB;
		}
		
	}

	private onComplete():void{
		var img: egret.Texture = RES.getRes(this.data.url);
		this.img_header.source = img;

	}

	
}